﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GPSTrackingDBCustom.Log
{
    public class AppLog
    {
        /// <summary>
        /// Logs an error message
        /// </summary>
        /// <param name="message">The message.</param>
        public static void Error(int companyID, string message, string username)
        {            
            GPSTrackingDBV2.Entities.Log LogEntity = new GPSTrackingDBV2.Entities.Log();
            LogEntity.DateTime = DateTime.Now;
            LogEntity.CompanyId = companyID;
            LogEntity.Description = message;
            LogEntity.Username = username;
            LogEntity.TypeInfoId = "E";

            GPSTrackingDBV2.Data.DataRepository.LogProvider.Insert(LogEntity);
        }

    }
}
